package com.sunjs.wechat.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunjs.model.LyLeaflet;
import com.sunjs.model.back.RestCode;
import com.sunjs.model.back.RestResponse;
import com.sunjs.wechat.service.WxLeafletService;


@RestController
@RequestMapping(value = "/wx/leafet")
public class WxLeafletController {
	
	@Autowired
	private WxLeafletService  wxLeafletService;
	
	//	首页轮播图
	@RequestMapping(value = "/select", method = RequestMethod.POST)
	public RestResponse<List<LyLeaflet>> select(@RequestBody LyLeaflet lyLeaflet) {
		try {
			List<LyLeaflet> pair = wxLeafletService.selectList(lyLeaflet);
			return  RestResponse.success(pair);
		} catch (Exception e) {
			return RestResponse.error(RestCode.FAIL);
		}
	}
	
	
	
}


